//
//  DBYRoadDetailTodayTableViewCell.m
//  MemoryTravel
//
//  Created by dllo on 15/12/26.
//  Copyright © 2015年 fcx. All rights reserved.
//

#import "DBYRoadDetailTodayTableViewCell.h"

@implementation DBYRoadDetailTodayTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
    }
    return self;
}
- (void)createSubViews
{
    self.todayLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.todayLabel];
    self.todayLabel.text = @"今日备注";
    [self.todayLabel mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.left.mas_equalTo(10);
        make.top.mas_equalTo(10);
        make.size.mas_equalTo(CGSizeMake(Width, 15));
        
    }];
    
    self.bigLabel = [[UILabel alloc]init];
    self.bigLabel.font = [UIFont systemFontOfSize:15];
    [self.contentView addSubview:self.bigLabel];
    [self.bigLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(10);
        make.top.equalTo(self.todayLabel.mas_bottom).offset(20);
        make.size.mas_equalTo(CGSizeMake(Width, 1000));
        
        
    }];
    
    
    
}

-(void)setMemo:(NSString *)memo{
    
    if (_memo != memo) {
        
        _memo = memo;
    }
    self.bigLabel.text = self.memo;
    self.bigLabel.numberOfLines = 0;
//    [self.bigLabel sizeToFit];

    CGFloat height = [DBYRoadDetailTableViewCell heightForContent:self.memo];
    
    [self.bigLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
       
        
        make.left.mas_equalTo(10);
        make.top.equalTo(self.todayLabel.mas_bottom).offset(20);
        make.size.mas_equalTo(CGSizeMake(Width, height));

        
    }];
    
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
